#import "ApprehensionVelvetController.h"
        
#import "ApprehensionVelvetModel.h"
#import "ApprehensionVelvetCell.h"
#import "Masonry.h"

@interface ApprehensionVelvetController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *luminaryTableView;
@property (nonatomic, strong) NSMutableArray *forestArray;

@end

@implementation ApprehensionVelvetController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self pioneerWonderConfigsview];
	[self kaleidoscopeJoyousXeroxfetchData];
}


- (UITableView *)figHandleTableView {
    if (!_luminaryTableView) {
        _luminaryTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _luminaryTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _luminaryTableView.estimatedRowHeight = 0;
        _luminaryTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _luminaryTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _luminaryTableView.delegate = self;
        _luminaryTableView.dataSource = self;
        _luminaryTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _luminaryTableView.showsVerticalScrollIndicator = NO;
        _luminaryTableView.showsHorizontalScrollIndicator = NO;
        _luminaryTableView.backgroundColor = UIColor.clearColor;
    }
    return _luminaryTableView;
}

//: 初始化页面UI
- (void)pioneerWonderConfigsview {

	[self.view addSubview:self.luminaryTableView];
	[self.luminaryTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


//: 懒加载数据模型数组
- (NSMutableArray *)forestArray {
	if (!_forestArray) {
		_forestArray = [NSMutableArray array];
	}
	return _forestArray;
}

//: 获取数据模型
- (void)kaleidoscopeJoyousXeroxfetchData {
	
}

#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.forestArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ApprehensionVelvetCell *luminousBrighten = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([ApprehensionVelvetCell class])];
    if (luminousBrighten == nil) {
        luminousBrighten = [[ApprehensionVelvetCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([ApprehensionVelvetCell class])];
    }
    luminousBrighten.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return luminousBrighten;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
	ApprehensionVelvetModel *velvetSerene = self.forestArray[indexPath.row];
	return velvetSerene.cableLuminescenceCellHeight;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
